<!DOCTYPE html>

<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>商品编辑</title>
		<!-- Bootstrap core CSS -->
		<link href="asserts/css/bootstrap.min.css" th:href="@{/asserts/css/bootstrap.min.css}" rel="stylesheet">

		<!-- Custom styles for this template -->
		<link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">

	</head>

	<body>
		<!-- 插入顶部部分topbar !-->
		<div th:replace="commons/bar::#topBar"></div>
		<div class="container-fluid">
			<div class="row">
				<!--插入左侧部分sidebar-->
				<div th:replace="commons/bar::#sidebar(activeUri='manage/admin')"></div>

				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<form action="#" th:action="@{/manage/goods}" method="post">
						<input type="hidden" name="goodsId" th:value="${goods.goodsId}">
						<input type="hidden" name="goodsTypeID" th:value="${goods.goodsTypeID}">

						<div class="form-row">
							<div class="col-md-6 mb-3">
								<label for="goodsName">商品名称:</label>
								<input th:value="${goods.goodsName}" type="text" class="form-control" id="goodsName"
									   name="goodsName" required>
							</div>
							<div class="col-md-6 mb-3">
								<label for="goodsPrice">商品定价：</label>
								<input th:value="${goods.goodsPrice}" type="number" name="goodsPrice" class="form-control"
									   id="goodsPrice" required>
							</div>

							<div class="col-md-6 mb-3">
								<label for="goodsPicture">商品图片　标志:</label>
								<input th:value="${goods.goodsPicture}" type="text" name="goodsPicture" class="form-control" id="goodsPicture" required>
							</div>

							<div class="col-md-6 mb-3">
								<label for="goodsPicture1">商品详情一级图片:</label>
								<input th:value="${goods.goodsPicture1}" type="text" name="goodsPicture1"
									   class="form-control" id="goodsPicture1" required>
							</div>

							<div class="col-md-6 mb-3">
								<label for="goodsPicture2">商品详情二级图片:</label>
								<input th:value="${goods.goodsPicture2}" type="text" name="goodsPicture2"
									   class="form-control" id="goodsPicture2" required>
							</div>

							<div class="col-md-6 mb-3">
								<label for="goodsPicture3">商品详情三级图片:</label>
								<input th:value="${goods.goodsPicture3}" type="text" name="goodsPicture3"
									   class="form-control" id="goodsPicture3" required>
							</div>

							<div class="col-md-6 mb-3">
								<label for="goodsPicture4">商品详情四级图片:</label>
								<input th:value="${goods.goodsPicture4}" type="text" name="goodsPicture4"
									   class="form-control" id="goodsPicture4" required>
							</div>

							<div class="col-md-6 mb-3">
								<label for="goodsPicture5">商品详情五级图片:</label>
								<input th:value="${goods.goodsPicture5}" type="text" name="goodsPicture5"
									   class="form-control" id="goodsPicture5" required>
							</div>

							<div class="col-md-6 mb-3">
								<label for="goodsPicture6">商品详情六级图片:</label>
								<input th:value="${goods.goodsPicture6}" type="text" name="goodsPicture6"
									   class="form-control" id="goodsPicture6" required>
							</div>

							<div class="col-md-6 mb-3">
								<label for="goodsType">类 型:</label>
								<input th:value="${goods.goodsType}" type="text" name="goodsType"
									   class="form-control" id="goodsType" required>
							</div>

							<div class="col-md-6 mb-3">
								<div class="custom-control custom-checkbox">
									<input type="checkbox" th:checked="${goods.isNew}" name="isNew"
										   class="custom-control-input"
										   id="isNew"
										   value="">
									<label class="custom-control-label" for="isNew">是否新品</label>
								</div>
							</div>

							<div class="col-md-6 mb-3">
								<div class="custom-control custom-checkbox">
									<input type="checkbox" th:checked="${goods.isSale}" name="isSale"
										   class="custom-control-input"
										   id="isSale"
										   value="">
									<label class="custom-control-label" for="isSale">是否特价</label>
								</div>

							</div>

							<div class="col-md-12 mb-6 form-group">
								<label for="goodsIntroduce">商品简介：</label>
								<textarea th:value="${goods.goodsPrice}"  name="goodsIntroduce" class="form-control"
										  id="goodsIntroduce" rows="5" >
								</textarea>
							</div>

						</div>

						<button class="btn btn-primary" type="submit" onclick="setCheckBox()">修 改</button>
						<a  class="btn btn-secondary" th:href="@{/manage/admin}">返 回</a>
					</form>


				</main>
			</div>
		</div>

		<!-- Bootstrap core JavaScript
    ================================================== -->
		<!-- Placed at the end of the document so the pages load faster -->
		<script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js" th:src="@{/asserts/js/jquery-3.2.1.slim.min.js}" ></script>
		<script type="text/javascript" src="asserts/js/popper.min.js" th:src="@{/asserts/js/popper.min.js}" ></script>
		<script type="text/javascript" src="asserts/js/bootstrap.min.js" th:src="@{/asserts/js/bootstrap.min.js}" ></script>

		<!-- Icons -->
		<script type="text/javascript" src="asserts/js/feather.min.js" th:src="@{/asserts/js/feather.min.js}" ></script>
		<script>
			feather.replace()
		</script>

		 <script type="text/javascript"  >
			function setCheckBox(){
				var iNew =document.getElementById("isNew");
				if (iNew.checked){
					iNew.value=1;
				}else {iNew.value=0}

				var iSale=document.getElementById("isSale");
				if (iSale.checked){
					iSale.value=1;
				}else {iSale.value=0}
			}
		</script>

	</body>

</html>